<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //固定好的的数据
        $created_at = date('Y-m-d H:i:s');
        $data = [
            ['name'=>'PHP', 'description'=>'PHP，真的不行了吗？','created_at'=>$created_at],
            ['name'=>'GO', 'description'=>'是的，你怎么还不转GO？','created_at'=>$created_at],
            ['name'=>'Vue', 'description'=>'是不是忘了我，小老弟','created_at'=>$created_at],
            ['name'=>'杂谈', 'description'=>'都可以谈','created_at'=>$created_at],
            ['name'=>'游戏', 'description'=>'电子阳痿了，朋友','created_at'=>$created_at],
        ];
        \Illuminate\Support\Facades\DB::table('categories')->insert($data);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        \Illuminate\Support\Facades\DB::table('categories')->truncate();
    }
};
